/*
 * @Description: 分页查询
 * @Author: huacong
 * @Date: 2020-11-10 21:34:34
 * @LastEditTime: 2020-11-10 21:43:12
 * @LastEditors: huacong
 */
import { mapState, mapMutations } from 'vuex'

export default {
  computed: {
    ...mapState({
      pager: state => state.app.pager
    }),
    pageParameter () {
      return this.pager[this.$route.path] || {}
    }
  },
  methods: {
    ...mapMutations({
      'SET_PAGER': 'app/SET_PAGER'
    }),
    tableCallback ({ parameter }) {
      this.SET_PAGER({
        [this.$route.path]: parameter
      })
    }
  }
}
